<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/admin/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/admin/css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
        .tdrow{
           font-weight: bold;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form">
 
    <form action="" method="post" id="DataForm">

    <table class="layui-table">
        <tbody>
            <tr>
                <td colspan="6" style="font-weight: bold;font-size: 16px;">
                    资金信息                   
                </td>
            </tr>
            <tr>
                <td><span class="tdrow">团长信息：</span>{$info.bus_title}</td>
                <td><span class="tdrow">操作用户：</span>{$info.user_title}</td>
                <td><span class="tdrow">提现金额：</span>{$info.money}</td>
                <td><span class="tdrow">状态：</span>{$info.state_text}</td>
            </tr>
            <tr>
                <td><span class="tdrow">支付宝姓名：</span>{$info.alipay_name}</td>
                <td><span class="tdrow">支付宝手机号：</span>{$info.alipay_phone}</td>
                <td><span class="tdrow">备注：</span>{$info.notes}</td>
                <td><span class="tdrow">创建时间：</span>{$info.addtime_text}</td>
            </tr>
            <tr>
                <td>
                    <span class="tdrow">状态：</span>
                    <select name="info[state]" lay-filter="state_select">
                        <option value="1">通过</option>
                        <option value="2">拒绝</option>
                    </select>
                </td>
                <td id="reject_content" style="display: none;">
                    拒绝内容：<textarea name="info[reject_content]"  class="layui-textarea"></textarea>
                </td>
                {if $info['state'] == 2}
                <td><span class="tdrow">拒绝内容：</span>{$info.reject_content}</td>
                {/if}
            </tr>

        </tbody>
    </table>
   {if $info['state'] != 1} 
    <div class="layui-form-item">
        <div class="layui-input-block" style="margin:auto;text-align: center;">
            <input type="hidden" name="id" value="{$info.id}">
            <button type="button" class="upButton layui-btn layui-btn-primary" id="closeButton"><i
                    class="fa fa-level-up"></i> 关闭</button>
            <button id="saveButton" type="submit" class="layui-btn"><i class="fa fa-check"></i>
                提交</button>
        </div>
    </div>
</form> 
{/if}

 
</div>
<script src="/static/admin/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/static/admin/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
            var look_pic;
      layui.use(['layer', 'form', 'laydate', 'element', 'upload'], function () {
        var $ = layui.$, layer = layui.layer, table = layui.table,  element = layui.element,laydate = layui.laydate, form = layui.form, upload = layui.upload;
        var indexFrame = parent.layer.getFrameIndex(window.name); //获取窗口索引

        $("#saveButton").on('click', function () {
            var loading = layer.open({ type: 3 });
            $.ajax({
                url: "{:url('info')}",
                type: 'post',
                data: $("#DataForm").serialize(),
                success: function (data) {
                    console.log(data);
                    layer.close(loading);
                    if (data.code == 0) {
                        parent.tableReload();
                        parent.layer.close(indexFrame);
                        parent.layer.msg(data.msg);
                    } else {
                        layer.msg(data.msg);
                    }
                }
            })
            return false;
        })

        $("#closeButton").on('click', function () {
            parent.layer.close(indexFrame);
        })

        form.on('select(state_select)', function(data){
            if(data.value == 2){
                $("#reject_content").show()
            }else{
                $("#reject_content").hide()
            }
        });

       

        });
</script>
</body>
</html>